﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace carsitem.zhangmu
{
    public partial class account : Form
    {
        public account()
        {
            InitializeComponent();
        }

        private void account_Load(object sender, EventArgs e)
        {
           
        }

        private void SelectOut_Click(object sender, EventArgs e)
        {
            
            string time = this.StartTime.Value.ToShortDateString().ToString();
            string shijian = this.OverTime.Value.ToShortDateString().ToString();

            string sql =@"select SellCount,Salay from Sell,Employee where sell.EmployeeID=Employee.EmployeeID ";
            DBHelper db = new DBHelper();
            DataTable tb = db.GetDataTableBySql(sql);
            DataColumn column = new DataColumn("支出");
            tb.Columns.Add(column);
            int xiao = Convert.ToInt32(tb.Rows[0]["SellCount"]);
            int gongzi = Convert.ToInt32(tb.Rows[0]["Salay"]);
            foreach (DataRow item in tb.Rows)
            {
                item["支出"] = string.Format("从{0}到{1}的支出总计为{2}",time, shijian,xiao+gongzi);
            }
            this.dataGridView1.DataSource = tb;
        }

        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

        }

        private void UpdateBt_Click(object sender, EventArgs e)
        {

        }
    }
}
